//
//  ZYCApplianceRootCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/7/17.
//

#import "ZYCApplianceRootCell.h"
#import "ZYCApplianceRootModel.h"

@interface ZYCApplianceRootCell ()
@property (nonatomic ,strong) UIImageView *iconView;
@property (nonatomic ,strong) UILabel *titleLabel;

@end

@implementation ZYCApplianceRootCell

- (void)setModel:(ZYCApplianceRootModel *)model{
    _model = model;
    _titleLabel.text = model.menuName;
   
    if ([model.menuId integerValue] == 540759249913018) {//新闻
        _iconView.image = [UIImage imageNamed:@"xw"];
    }else if ([model.menuId integerValue] == 540759249913019) {//公告
        _iconView.image = [UIImage imageNamed:@"ggg"];
    }else if ([model.menuId integerValue] == 540759249913020) {//通知
        _iconView.image = [UIImage imageNamed:@"tzz"];
    }else if ([model.menuId integerValue] == 540759249913081) {//周历
        _iconView.image = [UIImage imageNamed:@"zlll"];
    }else if ([model.menuId integerValue] == 540759249913022) {//值班记录
        _iconView.image = [UIImage imageNamed:@"zbgl"];
    }else if ([model.menuId integerValue] == 540759249913023) {//选课报名
        _iconView.image = [UIImage imageNamed:@"xkbm"];
    }else if ([model.menuId integerValue] == 540759249913024) {//巡堂记录
        _iconView.image = [UIImage imageNamed:@"xtgllll"];
    }else if ([model.menuId integerValue] == 540759249913028) {//值班报告
        _iconView.image = [UIImage imageNamed:@"zbjl"];
    }else if ([model.menuId integerValue] == 540759249913029) {//授课记录
        _iconView.image = [UIImage imageNamed:@"xtjlll"];
    }else if ([model.menuId integerValue] == 540759249913030) {//巡堂统计
        _iconView.image = [UIImage imageNamed:@"xttj"];
    }else if ([model.menuId integerValue] == 540759249913031) {//学生考勤
        _iconView.image = [UIImage imageNamed:@"xskq"];
    }else if ([model.menuId integerValue] == 540759249913173) {//教师考勤
        _iconView.image = [UIImage imageNamed:@"zbgl(1)"];
    }else if ([model.menuId integerValue] == 540759249913176) {//教师-请假记录
        _iconView.image = [UIImage imageNamed:@"xsqjjj"];
    }else if ([model.menuId integerValue] == 540759249913174) {//教师-考勤记录
        _iconView.image = [UIImage imageNamed:@"kqgl(1)"];
    }else if ([model.menuId integerValue] == 540759249913177) {//教师-请假申请
        _iconView.image = [UIImage imageNamed:@"kqtj"];
    }else if ([model.menuId integerValue] == 540759249913178) {//教师-学校考勤统计
        _iconView.image = [UIImage imageNamed:@"kqgl"];
    }else if ([model.menuId integerValue] == 540759249913032) {//教师就餐
        _iconView.image = [UIImage imageNamed:@"jsjc"];
    }else if ([model.menuId integerValue] == 540759249913159) {//请假记录
        _iconView.image = [UIImage imageNamed:@"xsqjjj"];
    }else if ([model.menuId integerValue] == 540759249913157) {//考勤记录
        _iconView.image = [UIImage imageNamed:@"kqgl(1)"];
    }else if ([model.menuId integerValue] == 540759249913160) {//考勤统计
        _iconView.image = [UIImage imageNamed:@"kqtj"];
    }else if ([model.menuId integerValue] == 540759249913161) {//考勤管理
        _iconView.image = [UIImage imageNamed:@"kqgl"];
    }else if ([model.menuId integerValue] == 540759249913165) {//听评课
        _iconView.image = [UIImage imageNamed:@"tpk"];
    }else if ([model.menuId integerValue] == 540759249913166) {//评教评学
        _iconView.image = [UIImage imageNamed:@"pjpxx"];
    }else if ([model.menuId integerValue] == 540759249913167) {//成长档案
        _iconView.image = [UIImage imageNamed:@"czda"];
    }else if ([model.menuId integerValue] == 540759249913168) {//资源中心
        _iconView.image = [UIImage imageNamed:@"zyzx"];
    }
    if ([model.menuName isEqualToString:@"test"] && [model.menuId isEqualToString:@"test"]) {
        _iconView.hidden = YES;
        _titleLabel.hidden = YES;
    }else{
        _iconView.hidden = NO;
        _titleLabel.hidden = NO;
    }
}



- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubview:self.iconView];
        [self.contentView addSubview:self.titleLabel];
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(55.0, 55.0));
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self.contentView).offset(16);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self.iconView.mas_bottom).offset(1);
        }];
    }
    return self;
}

- (UIImageView *)iconView {
    if (!_iconView) {
        _iconView = [[UIImageView alloc] init];
    }
    return _iconView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 16.0) titleColor:HEX_RGB(kTitleDrakBlackColor) textAlignment:ZZTextAlignmentCenter];
    }
    return _titleLabel;
}


@end
